<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.flying.dcss.app.SessionName"%>
<%@page import="com.flying.dcss.userpermissions.bo.impl.DcssUser"%>
<%
	DcssUser user = (DcssUser) session
			.getAttribute(SessionName.UserSession);
%>
<script language="javascript" type="text/javascript">

function showAddCity() {
	document.getElementById('addCity').className = 'part';
	document.getElementById('add1').className = 'btn';
	document.getElementById('cancel1').className = 'btn';
}

function showAddBuilding() {
	document.getElementById('addBuilding').className = 'part';
	document.getElementById('add2').className = 'btn';
	document.getElementById('cancel2').className = 'btn';
}

function showAddFloor() {
	document.getElementById('addFloor').className = 'part';
	document.getElementById('add3').className = 'btn';
	document.getElementById('cancel3').className = 'btn';
}

function hideAddCity() {
	document.getElementById('addCity').className += ' hide';
	document.getElementById('add1').className += ' hide';
	document.getElementById('cancel1').className += ' hide';
}

function hideAddBuilding() {
	document.getElementById('addBuilding').className += ' hide';
	document.getElementById('add2').className += ' hide';
	document.getElementById('cancel2').className += ' hide';
}

function hideAddFloor() {
	document.getElementById('addFloor').className += ' hide';
	document.getElementById('add3').className += ' hide';
	document.getElementById('cancel3').className += ' hide';

}
</script>
<dl>
	<dt style="margin: 20px">
		门禁信息添加：
	</dt>
</dl>
<input type="button" id="currentUserId" value="<%=user.getId()%>"
	style="display: none"></input>

<p class="part">
	<label for="smallbox" class="exp">
		城市：
	</label>

	<select name="" id="citySelect"
		onchange="getBuildingInfo(this.options[this.selectedIndex].value);"
		class="sel"></select>
</p>

<input name="" type="button" value="添加" class="btn"
	onclick="showAddCity();" />

<p id="addCity" class="hide part">
	<label for="smallbox" class="exp">
		城市：
	</label>
	<input id="cityName" name="cityName" type="text"
		class="inputbox smallbox" />
</p>
<input id="add1" name="" onclick="addCityAction();hideAddCity();"
	type="button" value="添加" class="btn hide" />
<input id="cancel1" name="" onclick="hideAddCity();" type="button"
	value="取消" class="btn hide" />

<br />
<p class="part">
	<label for="smallbox" class="exp">
		建筑名：
	</label>
	<select name="" class="sel" id="buildingSelect"
		onchange="getFloorInfo(this.options[this.selectedIndex].value);">
		<option>请先选择前置条件</option></select>
</p>

<input name="" type="button" value="添加" onclick="showAddBuilding();"
	class="btn" />

<p id="addBuilding" class="hide part">
	<label for="smallbox" class="exp">
		建筑名：
	</label>
	<input name="" id="buildingName" type="text" class="inputbox smallbox" />
</p>
<input id="add2" name=""
	onclick="addBuildingAction();hideAddBuilding();" type="button"
	value="添加" class="btn hide" />
<input id="cancel2" name="" onclick="hideAddBuilding();" type="button"
	value="取消" class="btn hide" />
<br />
<p class="part">
	<label for="smallbox" class="exp">
		楼层：
	</label>
	<select name="" id="floorSelect" class="sel"><option>请先选择前置条件</option></select>
</p>
<input name="" type="button" value="添加" class="btn"
	onclick="showAddFloor();" />
<p id="addFloor" class="hide part">
	<label for="smallbox" class="exp">
		楼层：
	</label>
	<input name="" id="floorName" type="text" class="inputbox smallbox" />
</p>
<input id="add3" name="" onclick="addFloorAction();hideAddFloor();"
	type="button" value="添加" class="btn hide" />
<input id="cancel3" name="" onclick="hideAddFloor();" type="button"
	value="取消" class="btn hide" />
<br />
<p class="part">
	<label for="smallbox" class="exp">
		功用：
	</label>
	<input name="" type="text" id="desciption" class="inputbox smallbox" />
</p>
<br />
<p class="part">
	<label for="smallbox" class="exp">
		拥有者：
	</label>
	<input name="" type="text" id="manager" class="inputbox smallbox" />
</p>
<p class="part">
	<input name="" type="button" value="提交申请" class="btn"
		onclick="createdc();" />
</p>

<script language="javascript" type="text/javascript">
getCityInfo();
dcManagerAutoCompl();

var hl = document.getElementById("high2");
hl.setAttribute("id", "active2");
</script>
